#pragma once
#include "RBTree.h"

namespace bit
{	
	template<class K>
	class set
	{
		struct setKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};

	public:
		typedef typename RBTree<K, K, setKeyOfT>::const_iterator iterator;
		typedef typename RBTree<K, K, setKeyOfT>::const_iterator const_iterator;
		iterator begin()
		{
			return _t.begin();      
		}

		iterator end()
		{
			return _t.end();
		}

		const_iterator begin()const
		{
			return _t.begin();
		}

		const_iterator end()const
		{
			return _t.end();
		}

		pair<iterator,bool> Insert(const K& key)
		{
			pair<typename RBTree<K, K, setKeyOfT>::iterator, bool>ret = _t.Insert(key);
			return pair<iterator, bool>(ret.first, ret.second);
		}

	private:
		RBTree<K,K,setKeyOfT>_t;
	};

}